#include<stdio.h>
#include<string.h>
#include<unistd.h>

#define NUM 102

int main()
{
    char bar[NUM];
    memset(bar, 0, sizeof(bar));
    int cnt = 0;
    const char* lable = "|/-\\";
    while (cnt <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", bar, cnt, lable[cnt%4]);
        bar[cnt++] = '=';
        fflush(stdout);
        usleep(30000);
    }
    printf("\n");
    return 0;
}
